from django import template
from django.conf import settings

register = template.Library()

def sharethis():
    sharethis_publisher = getattr(settings, 'SHARETHIS_PUBLISHER', None)
    if sharethis_publisher:
        return """<script type="text/javascript" 
src="http://w.sharethis.com/button/sharethis.js#%s&amp;type=website&amp;style=rotate"></script>""" % settings.SHARETHIS_PUBLISHER
    else:
        return ""

register.simple_tag(sharethis)
